package main

import (
	"github.com/kataras/iris/v12"
	"github.com/kataras/iris/v12/mvc"
	"os"
)

const storageDir = "storage"

func main() {
	_, err := os.Stat(storageDir)
	if err != nil {
		if os.IsNotExist(err) {
			err = os.Mkdir(storageDir, os.ModePerm)
			if err != nil {
				panic(err)
			}
		} else {
			panic(err)
		}
	}
	app := iris.New()
	iris.WithoutPathCorrectionRedirection(app)
	mvc.Configure(app.Party("/"), func(application *mvc.Application) {
		application.Handle(&Controller{})
	})
	tmpl := iris.HTML("./", ".html")
	app.RegisterView(tmpl)
	_ = app.Listen(":80")
}

func getA(ctx iris.Context) {

}
